<%--
  Created by IntelliJ IDEA.
  User: 小强
  Date: 2021/10/7
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../css/menustyle.css">

</head>


<div class="container-fluid">
    <div class="row-fluid clearfix">
        <!-- 导航栏 -->
        <div id="sidebar">
            <header>
                <a href="#">后台管理</a>
            </header>
            <ul class="nav">
                <li>
                    <a href="${pageContext.request.contextPath}/admin/allReader">
                        读者管理
                    </a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/bookIO/toAllIOBook">
                        出入库管理
                    </a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/Lend/adminAllBook">
                        借阅管理
                    </a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/type/allType">
                        分类管理
                    </a>
                </li>
            </ul>
        </div>

        <!-- 正文 -->
        <div id="content">
            <div class="container-fluid" style="margin-left: 250px">
                <!-- 网页内容 -->

                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <div class="page-header">
                            <h1>
                                <small>书籍列表 —— 出入库管理</small>
                            </h1>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-12 column">
                        <a class="btn btn-primary" href="${pageContext.request.contextPath}/bookIO/toStoreBook">书籍录入</a>
                        <a class="btn btn-primary" href="${pageContext.request.contextPath}/bookIO/toAllIOBook">显示所有书籍</a>
                        <a class="btn btn-primary" href="${pageContext.request.contextPath}/bookIO/toOutedBook">显示已出库</a>
                        <form action="${pageContext.request.contextPath}/bookIO/queryBookByName" method="post"
                              class="form-search form-inline" style="float: right">
                            <span style="color:red;font-weight: bold">${err}</span>
                            <input class="input-medium search-query form-control"
                                   name="queryBookName" type="text" placeholder="请输入书籍名称"/>
                            <input type="submit" class="btn btn-primary" value="查询"/>
                        </form>
                    </div>


                </div>

                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <table class="table table-hover table-striped">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>书号</th>
                                <th>名称</th>
                                <th>作者</th>
                                <th>出版社</th>
                                <th>数量</th>
                                <th>详情</th>
                                <th>操作</th>
                            </tr>
                            </thead>

                            <tbody>
                            <c:forEach var="book" items="${requestScope.get('list')}">
                                <tr>
                                    <td>${book.getBookID()}</td>
                                    <td>${book.getIsbn()}</td>
                                    <td>${book.getBookName()}</td>
                                    <td>${book.getAuthor()}</td>
                                    <td>${book.getPress()}</td>
                                    <td>${book.getBookCount()}</td>
                                    <td>${book.getDetail()}</td>
                                    <td>
                                        <a href="${pageContext.request.contextPath}/bookIO/outBook/?id=${book.getBookID()}">出库</a>&nbsp;|
                                        <a href="${pageContext.request.contextPath}/bookIO/toBookDetail?id=${book.getBookID()}">更多>></a>
                                    </td>
                                </tr>
                            </c:forEach>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

